﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using Bookkeeping.Persistence;
using Bookkeeping.Core.Entities;

namespace Bookkeeping.Tests.Utilities
{
    public class DataDeleter
    {
        public static void DeleteAllData()
        {
            using (ISession session = SessionFactorySingleton.OpenSession())
            using (ITransaction transaction = session.BeginTransaction())
            {
                session.Delete("from Post p");
                session.Delete("from Tag t");

                //session.CreateQuery("delete Post p").ExecuteUpdate();
                //session.CreateQuery("delete Tag t").ExecuteUpdate();

                transaction.Commit();
            }
        }
    }
}
